﻿using System;
using System.Runtime.Serialization;

namespace FranceTriple.Dal
{
    public class DalException : Exception
    {
        public DalException() : base() { }

        public DalException(String message) : base(message) { }

        public DalException(String message, Exception inner) : base(message, inner) { }

        public DalException(SerializationInfo info, StreamingContext context) : base(info, context) 
        {
            EntityType = (Type)info.GetValue("EntityType", typeof(Type));
        }

        public Type EntityType { get; set; }

        override public void GetObjectData(SerializationInfo info, StreamingContext ctxt)
        {
             info.AddValue("EntityType", EntityType);            
        }

    }
}
